#ifndef ACCOUNT_H
#define ACCOUNT_H

#include "mempool.h"

enum PLAYER_COLOR_TYPE
{
	PLAYER_COLOR_RED = 0,
	PLAYER_COLOR_GREEN,
	PLAYER_COLOR_BLUE,
	PLAYER_COLOR_YELLOW,
	PLAYER_COLOR_BLACK,
	PLAYER_COLOR_WHITE,
	PLAYER_COLOR_COUNT,
};
enum ACCOUNT_TYPE
{
	ACCT_PLAYER, // Normal player
	ACCT_OBER,	 // Can join game to chat, but cannot play
	ACCT_ADMIN,  // Can join game to chat, can kick player, observer, diver, etc..
	ACCT_DIVER,	 // Can join game, cannot chat, cannot play
};
#define MAX_PLAYER (PLAYER_COLOR_COUNT)
struct account
{
	unsigned int id;
	unsigned int version; // protocol version, acct_info may change, should be backward compatible
	struct account_info *acct_info;
};
struct acct_time
{
	unsigned int year;
	unsigned int month;
	unsigned int day;
	unsigned int hour;
	unsigned int min;
	unsigned int sec;
};
// version 1
struct account_info
{
	unsigned int ver; // version 1
	unsigned int acct_type; // Player, Observer, Admin, Diver
	char *name;
	char *passwd;
	//int color; // see PLAYER_COLOR_TYPE
	unsigned int level;
	//int time_played[6]; // 0: year, 1: month, 2: day, 3: hour, 4: min, 5: sec
	struct acct_time time_played;
};



//void create_account(int id, int version, void *data);
void create_account(unsigned int id, unsigned int version, struct account_info *data);
int AH_create_account(char *acct_name , char *passwd);
#endif
